<?php
	$ci = &get_instance(); 
?>
<section class="title">
<?php if ($this->method == 'create'): ?>
	<h4><?php echo lang('escort_be_agent_create_title'); ?></h4>	<?php $readonly = ""; ?>
		<?php else: ?>
	<h4><?php echo sprintf(lang('escort_be_agent_edit_title'), $user->username); ?></h4>
	<?php $readonly = 'readonly="readonly"'; ?>
<?php endif; ?>
</section>

<section class="item">
	
<?php echo form_open(uri_string(), 'class="crud" '); ?>
<div class="form_inputs" id="news-form">

	<fieldset>
	
		<ul>
			<li class="even multi-column">
				<ul>
					<li>
						<label for="site_ref"><?php echo lang('escort_be_agent_site_label'); ?></label>
						<div class="input"><?php echo form_dropdown('site_ref', $sites, $user->site_ref, 'maxlength="100"'); ?></div>
					</li>
					<li>
						<label for="name"><?php echo lang('escort_be_agent_name_label'); ?></label>
						<div class="input"><?php echo form_input('name', $user->name, 'maxlength="100"'); ?></div>
					</li>
				</ul>
								
			</li>
			<li class="odd multi-column">
				<ul>
					<li>
						<label for="username"><?php echo lang('escort_be_agent_username_label'); ?> <span>*</span></label>
						<div class="input"><?php echo form_input('username', $user->username, 'maxlength="100" '.$readonly.''); ?></div>
					</li>
					<li>
						<label for="phone"><?php echo lang('escort_be_agent_phone_label'); ?> <span>*</span></label>
						<div class="input"><?php echo form_input('phone', $user->phone, 'maxlength="100"'); ?></div>
					</li>
				</ul>				
			</li>
			<li class="odd multi-column">
				<ul>
					<li>
						<label for="password"><?php echo lang('escort_be_agent_password_label'); ?> <span>*</span></label>
						<div class="input"><?php echo form_password('password', '', 'maxlength="100"'); ?></div>
					</li>
					<li>
						<label for="email"><?php echo lang('escort_be_agent_email_label'); ?> <span>*</span></label>
						<div class="input"><?php echo form_input('email', $user->email, 'maxlength="100" '.$readonly.''); ?></div>
					</li>
				</ul>				
			</li>
			<li class="odd multi-column">
			<ul>
			<li>
			<label for="password"><?php echo lang('escort_be_agent_retype_password_label'); ?> <span>*</span></label>
				<div class="input"><?php echo form_password('retype_password', '', 'maxlength="100"'); ?></div>
					</li>
					<li>
						<label for="address"><?php echo lang('escort_be_agent_address_label'); ?> <span>*</span></label>
						<div class="input"><?php echo form_input('address', $user->address, 'maxlength="100"'); ?></div>
					</li>
				</ul>				
			</li>
			<li class="even multi-item">
				<ul>
					<li>
						<?php echo form_dropdown('country_id', $countryList, $user->country_id, 'id="country_1" class="country_select"') ?>
					</li>
					<li>
						<?php echo form_dropdown('region_id', $ci->escort_user_roles_n_zones_entity->getStateList($username, $usergroup, $user->country_id), $user->state_id, 'id="state_country_1" class="state_select"') ?>
					</li>
					<li id="province_state_country_1_wrapper">
						<?php echo form_dropdown('province_id', $ci->escort_user_roles_n_zones_entity->getProvinceList($username, $usergroup, $user->country_id, $user->state_id), $user->province_id, 'id="province_state_country_1" class="provice_select"') ?>
					</li>
					<li>
						<?php echo form_dropdown('city_id', array('0' => lang('escort_be_agent_all_city_label')) + getCityData_ioc($user->country_id, $user->state_id, $user->province_id ),  $user->city_id, 'id="city_state_country_1" class="city_select"') ?>
					</li>
				</ul>
			</li>
			<li class="odd">
				<label for="commission"><?php echo lang('escort_be_agent_comission_label') ?></label>
				<div class="input"><?php echo form_input('commission',$user->commission, '')?></div>
			</li>
			<li class="odd">
				<label for="wallet"><?php echo lang('escort_be_agent_wallet_label') ?></label>
				<div class="input"><?php echo form_input('wallet',$user->wallet, $readonly)?></div>
			</li>
			<li>
				<label for="status"><?php echo lang('escort_be_agent_active_label')?></label>
				<div class="input"><?php echo form_checkbox('status', 1, $user->status)?></div>
			</li>
		</ul>
	</fieldset>
</div>
<div class="buttons float-right padding-top">
<?php $this->load->view('admin/partials/buttons', array('buttons' => array('save', 'save_exit', 'cancel'))); ?>
</div>
<?php echo form_close(); ?>
</section>